package com.dxysun.springboot.controller;

import com.alibaba.fastjson.JSON;
import com.dxysun.springboot.controller.aop.MyController;
import com.dxysun.springboot.dto.User;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/gateway")
public class GateWayController
{
    private static final Log logger = LogFactory.getLog(GateWayController.class);

    @RequestMapping("/user")
    @ResponseBody
    public User user(@RequestBody User user)
    {
        logger.info("get user:" + JSON.toJSONString(user));
        user.setName("newName");
        user.setGender("female");
        return user;
    }
}
